
import pymysql
host = 'localhost'
port = 3306
db = 'shensds_db'
user = 'root'
password = '123456'

conn = pymysql.connect(host=host, port=port, db=db, user=user, password=password)
cursor = conn.cursor()
for i in range(1000000):
    sql = "create table student%s(id int not null, name char(10), age int, address char(20), create_time datetime)" %i
    cursor.execute(sql)
    conn.commit()

cursor.close()
conn.close()

exit()
for i in range(8, 1000):
    name = "张瑶%s" % i
    sql = "INSERT INTO shends(id, 姓名)  VALUES (%s, %s)"
    params = (str(i), '张瑶%s' %i)
    cursor.execute(sql, params)
    conn.commit()

cursor.close()
conn.close()

